package com.hua.yuan.ui.module;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * 时间：2018/8/26
 * 作者：蓝天
 * 描述：
 */
public class ImageDetail implements Parcelable {

    /**
     * atlas_id : 196
     * title : 4
     * atlas_desc : 4
     * type : 1
     * subtype : 1
     * classify : 2
     * classifyDesc : 绳艺文化
     * cover_img_id : 212
     * is_on : 1
     * origin_price : 4
     * now_price : 4
     * is_free : 0
     * img_url : http://video001.guduokeji.com/admin/action/garden/upload/imgbb1469ad3d21a04760cf719a86f2e7be.jpeg
     * pictures_list : [{"picture_id":211,"img_url":"http://video001.guduokeji.com/admin/action/garden/upload/imgbb1469ad3d21a04760cf719a86f2e7be.jpeg"}]
     */

    private int atlas_id;
    private String title;
    private String atlas_desc;
    private int type;
    private int subtype;
    private int classify;
    private String classifyDesc;
    private int cover_img_id;
    private int is_on;
    private String origin_price;
    private String now_price;
    private String is_free;//是否收费（1表示免费、0收费）
    private String img_url;
    private String has_collect = "1";//0表示没收藏 1表示已经收藏
    private String has_buy = "0";//0没购买 1购买
    private String play_num = "";
    private List<PicturesListBean> pictures_list;

    public String getPlay_num() {
        return play_num == null ? "" : play_num;
    }

    public void setPlay_num(String play_num) {
        this.play_num = play_num;
    }

    public String getHas_collect() {
        return has_collect == null ? "0" : has_collect;
    }

    public void setHas_collect(String has_collect) {
        this.has_collect = has_collect;
    }

    public String getHas_buy() {
        return has_buy == null ? "" : has_buy;
    }

    public void setHas_buy(String has_buy) {
        this.has_buy = has_buy;
    }

    public int getAtlas_id() {
        return atlas_id;
    }

    public void setAtlas_id(int atlas_id) {
        this.atlas_id = atlas_id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAtlas_desc() {
        return atlas_desc;
    }

    public void setAtlas_desc(String atlas_desc) {
        this.atlas_desc = atlas_desc;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getSubtype() {
        return subtype;
    }

    public void setSubtype(int subtype) {
        this.subtype = subtype;
    }

    public int getClassify() {
        return classify;
    }

    public void setClassify(int classify) {
        this.classify = classify;
    }

    public String getClassifyDesc() {
        return classifyDesc;
    }

    public void setClassifyDesc(String classifyDesc) {
        this.classifyDesc = classifyDesc;
    }

    public int getCover_img_id() {
        return cover_img_id;
    }

    public void setCover_img_id(int cover_img_id) {
        this.cover_img_id = cover_img_id;
    }

    public int getIs_on() {
        return is_on;
    }

    public void setIs_on(int is_on) {
        this.is_on = is_on;
    }

    public String getOrigin_price() {
        return origin_price;
    }

    public void setOrigin_price(String origin_price) {
        this.origin_price = origin_price;
    }

    public String getNow_price() {
        return now_price;
    }

    public void setNow_price(String now_price) {
        this.now_price = now_price;
    }

    public String getIs_free() {
        return is_free;
    }

    public void setIs_free(String is_free) {
        this.is_free = is_free;
    }

    public String getImg_url() {
        return img_url;
    }

    public void setImg_url(String img_url) {
        this.img_url = img_url;
    }

    public List<PicturesListBean> getPictures_list() {
        return pictures_list;
    }

    public void setPictures_list(List<PicturesListBean> pictures_list) {
        this.pictures_list = pictures_list;
    }

    public static class PicturesListBean implements Parcelable {
        /**
         * picture_id : 211
         * img_url : http://video001.guduokeji.com/admin/action/garden/upload/imgbb1469ad3d21a04760cf719a86f2e7be.jpeg
         */

        private int picture_id;
        private String img_url;

        public int getPicture_id() {
            return picture_id;
        }

        public void setPicture_id(int picture_id) {
            this.picture_id = picture_id;
        }

        public String getImg_url() {
            return img_url;
        }

        public void setImg_url(String img_url) {
            this.img_url = img_url;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(this.picture_id);
            dest.writeString(this.img_url);
        }

        public PicturesListBean() {
        }

        protected PicturesListBean(Parcel in) {
            this.picture_id = in.readInt();
            this.img_url = in.readString();
        }

        public static final Creator<PicturesListBean> CREATOR = new Creator<PicturesListBean>() {
            @Override
            public PicturesListBean createFromParcel(Parcel source) {
                return new PicturesListBean(source);
            }

            @Override
            public PicturesListBean[] newArray(int size) {
                return new PicturesListBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.atlas_id);
        dest.writeString(this.title);
        dest.writeString(this.atlas_desc);
        dest.writeInt(this.type);
        dest.writeInt(this.subtype);
        dest.writeInt(this.classify);
        dest.writeString(this.classifyDesc);
        dest.writeInt(this.cover_img_id);
        dest.writeInt(this.is_on);
        dest.writeString(this.origin_price);
        dest.writeString(this.now_price);
        dest.writeString(this.is_free);
        dest.writeString(this.img_url);
        dest.writeString(this.has_collect);
        dest.writeString(this.has_buy);
        dest.writeString(this.play_num);
        dest.writeList(this.pictures_list);
    }

    public ImageDetail() {
    }

    protected ImageDetail(Parcel in) {
        this.atlas_id = in.readInt();
        this.title = in.readString();
        this.atlas_desc = in.readString();
        this.type = in.readInt();
        this.subtype = in.readInt();
        this.classify = in.readInt();
        this.classifyDesc = in.readString();
        this.cover_img_id = in.readInt();
        this.is_on = in.readInt();
        this.origin_price = in.readString();
        this.now_price = in.readString();
        this.is_free = in.readString();
        this.img_url = in.readString();
        this.has_collect = in.readString();
        this.has_buy = in.readString();
        this.play_num = in.readString();
        this.pictures_list = new ArrayList<PicturesListBean>();
        in.readList(this.pictures_list, PicturesListBean.class.getClassLoader());
    }

    public static final Parcelable.Creator<ImageDetail> CREATOR = new Parcelable.Creator<ImageDetail>() {
        @Override
        public ImageDetail createFromParcel(Parcel source) {
            return new ImageDetail(source);
        }

        @Override
        public ImageDetail[] newArray(int size) {
            return new ImageDetail[size];
        }
    };
}
